/**

 * @author zhaokai

 * @date 2019-10-30 22:33

 */
import _ from 'lodash';
import './style/index.css';
import printMe from './print';

function component() {
    let element = document.createElement('div');
    var btn = document.createElement('button');
    element.innerHTML = _.join(['Hello', 'webpack'], ' ');
    btn.innerHTML = 'Click me and check the console test!';
    btn.onclick = printMe;
    element.appendChild(btn);

    return element
}

console.log(module.hot);
let element = component()
if (module.hot) {
    module.hot.accept('./print.js', function () {
        console.log('Accepting the updated printMe module!');
        printMe();
    })
}
document.body.appendChild(component())